﻿@model Mvc.Models.Permission

@{
    var options = new AjaxOptions()
                      {
                          Url = Url.Action("modify", "Permissions"),
                          LoadingElementId = "",
                          UpdateTargetId = "content",
                          InsertionMode = InsertionMode.Replace, // <-- Replace the content of DOM element
                          HttpMethod = "POST",


                      };  
}


@using (Ajax.BeginForm(options)) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Permission</legend>

        @Html.HiddenFor(model => model.PermissionId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Controlador)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Controlador)
            @Html.ValidationMessageFor(model => model.Controlador)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Accion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Accion)
            @Html.ValidationMessageFor(model => model.Accion)
        </div>

        <div class="editor-label">
            @Html.HiddenFor(model => model.GroupId)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Concedido)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Concedido)
            @Html.ValidationMessageFor(model => model.Concedido)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
